package com.gordon.wiki.req;

import lombok.Data;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;

/**
 * @Projectname: wiki
 * @Filename: UserSaveReq
 * @Author: GordonLo
 * @Data:2022/11/17 16:57
 * @Description: TODO
 */
@Data
public class UserSaveReq {
    private Long id;

    @NotNull(message = "【用户名】不能为空")
    private String login_name;

    @NotNull(message = "【昵称】不能为空")
    private String name;

    @NotNull(message = "【密码】不能为空")
    // @Length(min = 6, max = 20, message = "【密码】6~20位")
    @Pattern(regexp = "^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,32}$", message = "【密码】至少包含 数字和英文，长度6-32")
    private String password;
}